#!/usr/bin/env bash
# Copyright (c) 2021 The Toltec Contributors
# SPDX-License-Identifier: MIT

pkgnames=(retris)
pkgdesc="Tetris game"
url=https://github.com/LinusCDE/retris
pkgver=0.6.3-4
timestamp=2021-01-30T02:41Z
section="games"
maintainer="Linus K. <linus@cosmos-ink.net>"
license=MIT
installdepends=(display)
flags=(patch_rm2fb)

image=rust:v2.1
source=(https://github.com/LinusCDE/retris/archive/0.6.3-1.zip)
sha256sums=(ecc7215098c03e79cd92b1835626e6739a5a932d5aa709899d183347e2a4108e)

build() {
    # Fall back to system-wide config
    rm .cargo/config
    cargo build --release
}

package() {
    install -D -m 755 -t "$pkgdir"/opt/bin "$srcdir"/target/armv7-unknown-linux-gnueabihf/release/retris
    install -D -m 644 "$srcdir"/oxide "$pkgdir"/opt/etc/draft/retris
    install -D -m 644 "$srcdir"/icon.png "$pkgdir"/opt/etc/draft/icons/retris.png
}
